﻿<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="DependencyDirector.MainWindow"
    Title="SQL Dependency Director" Height="764" Width="1081" AllowsTransparency="False" WindowStyle="ThreeDBorderWindow" Foreground="Black" Background="DarkGray" Icon="/DependencyDirector;component/Images/loading.gif" Visibility="Visible" ResizeMode="CanResizeWithGrip" WindowStartupLocation="CenterScreen" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">

    <Grid>
        <Grid.Resources>
            <Style x:Key="{x:Type Label}" TargetType="Label">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Label">
                            <Border>
                                <ContentPresenter
                  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                  RecognizesAccessKey="False" />
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </Grid.Resources>

        <Image x:Name="image1" Stretch="Fill" Source="/DependencyDirector;component/Images/bkg_BlackAndWhite_Small.png" IsEnabled="True" Visibility="Visible" />
        <!-- SQL Server Login -->
        <StatusBar Height="23" x:Name="statusBar1" VerticalAlignment="Bottom" Opacity="0.42" Background="#FF000000" Margin="0,0,0,0.4" />
        <Label Height="23" x:Name="lblCountofTables" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="82" HorizontalContentAlignment="Right" FontWeight="Bold" Margin="0,0,17,0" Foreground="#FFFFFFFF"/>
        <Label Height="23" HorizontalAlignment="Right" Margin="0,0,99,0" x:Name="lblTitle_CountofTables" VerticalAlignment="Bottom" Width="177" Content="Total Objects:" Foreground="#FFFFFFFF" FontSize="10"/>
        <ListBox Visibility="Hidden" ItemsSource="{Binding Mode=Default}" Margin="0,11,182,0" MaxWidth="259" x:Name="lbAllTables" SelectionChanged="lbAllTables_SelectionChanged" TabIndex="10" d:LayoutOverrides="GridBox" FontSize="12" Height="56" VerticalAlignment="Top" HorizontalAlignment="Right" Width="39">
            <ListBox.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFE1E1E1" Offset="0" />
                    <GradientStop Color="#FFFFFFFF" Offset="1" />
                </LinearGradientBrush>
            </ListBox.Background>
        </ListBox>
        <Button Height="31" HorizontalAlignment="Right" Margin="0,0,111,42.053" x:Name="btnRefresh" VerticalAlignment="Bottom" Width="76" Click="btnRefresh_Click" Visibility="Visible" Content="Refresh"/>
        <ListBox ItemsSource="{Binding}" HorizontalAlignment="Right" Margin="0,0,17,108.53" x:Name="lsbReportsConnected" Width="196.765" Height="115.47" VerticalAlignment="Bottom">
            <ListBox.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFE1E1E1" Offset="0"/>
                    <GradientStop Color="#FFFFFFFF" Offset="1"/>
                </LinearGradientBrush>
            </ListBox.Background>
        </ListBox>
        <Label ClipToBounds="False" Foreground="White" Height="29" HorizontalAlignment="Right" Margin="0,0,17,221" x:Name="label5" Padding="0,5" VerticalAlignment="Bottom" Width="196.765" Content="SQL Reports"/>
        <ProgressBar Height="23" HorizontalAlignment="Right" Margin="0,174,17,0" x:Name="pgbReportServerProgress" VerticalAlignment="Top" Width="196.765" IsIndeterminate="False" Foreground="Orange" BorderBrush="Black" >
            <ProgressBar.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FF000000" Offset="0"/>
                    <GradientStop Color="#FF282828" Offset="1"/>
                </LinearGradientBrush>
            </ProgressBar.Background>
        </ProgressBar>
        <Button Height="23" HorizontalAlignment="Right" Margin="0,123,134.765,0" x:Name="btnStartReportListing" VerticalAlignment="Top" Width="79" Click="btnStartReportListing_Click" IsEnabled="False" Content="Start"/>
        <Label ClipToBounds="False" Foreground="White" Height="27" HorizontalAlignment="Right" Margin="0,96,51.765,0" x:Name="label7" Padding="0,5" VerticalAlignment="Top" Width="162" Content="Retrieve SSRS Report Listing"/>
        <Button Height="23" HorizontalAlignment="Right" Margin="0,123,51.765,0" x:Name="btnCancelReportListing" VerticalAlignment="Top" Width="79" Click="btnCancelReportListing_Click" IsEnabled="False" IsCancel="True" Content="Cancel"/>
        <Label ClipToBounds="False" Foreground="White" Height="25" HorizontalAlignment="Right" Margin="0,149,17,0" x:Name="label8" Padding="0,5" VerticalAlignment="Top" Width="196.765" Content="Retrieval Progress"/>
        <Label Height="23" HorizontalAlignment="Right" Margin="0,174,95,0" x:Name="lblReportServerProgress" VerticalAlignment="Top" Width="111.389" FontSize="10" FontWeight="Bold" Foreground="Chartreuse">
            <Label.BitmapEffect>
                <OuterGlowBitmapEffect GlowColor="Black" GlowSize="3" />
            </Label.BitmapEffect>
        </Label>
        <Separator Height="8" Margin="10,81,16,0" x:Name="separator1" VerticalAlignment="Top" Grid.RowSpan="1" BorderBrush="#FFE3DEDE" Foreground="#FFF7F7F7" Background="#FFFFFFFF" Grid.ColumnSpan="1" Width="Auto" />
        <Label Height="26" Margin="144,59,256,0" x:Name="lblSQLServerName" VerticalAlignment="Top" FontSize="14" Content="No Connection" VerticalContentAlignment="Center" Padding="0" Visibility="Visible">
            <Label.Foreground>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFB6B6B6" Offset="0.562"/>
                    <GradientStop Color="#FFFFFFFF" Offset="1"/>
                </LinearGradientBrush>
            </Label.Foreground>
            <Label.BitmapEffect>
                <DropShadowBitmapEffect />
            </Label.BitmapEffect>
        </Label>




        <TextBox Height="23" Margin="0,225,254,0" x:Name="txtSelectedObjectID" VerticalAlignment="Top" FlowDirection="LeftToRight" FontSize="10" TextAlignment="Right" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Right" Background="AliceBlue" IsReadOnly="True" HorizontalAlignment="Right" Width="228.223" />
        <Label Height="23" HorizontalAlignment="Right" Margin="0,225,386,0" x:Name="label9" VerticalAlignment="Top" Width="96" FlowDirection="LeftToRight" FontSize="10" VerticalContentAlignment="Center" Foreground="CadetBlue" Content="Selected Object ID"/>
        <Label FontSize="35" Height="58" Margin="10,2,0,0" x:Name="label10" Padding="0" VerticalAlignment="Top" VerticalContentAlignment="Center" Visibility="Visible" HorizontalAlignment="Left" Width="444" Content="SQL Dependency Director">
            <Label.Foreground>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFB6B6B6" Offset="0.562" />
                    <GradientStop Color="White" Offset="1" />
                </LinearGradientBrush>
            </Label.Foreground>
            <Label.BitmapEffect>
                <DropShadowBitmapEffect />
            </Label.BitmapEffect>
        </Label>
        <Label FontSize="14" Height="26" HorizontalAlignment="Left" Margin="10,59,0,0" x:Name="label11" Padding="0" VerticalAlignment="Top" VerticalContentAlignment="Center" Visibility="Visible" Width="135" Content="Current Connection:">
            <Label.Foreground>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFB6B6B6" Offset="0.562" />
                    <GradientStop Color="White" Offset="1" />
                </LinearGradientBrush>
            </Label.Foreground>
            <Label.BitmapEffect>
                <DropShadowBitmapEffect />
            </Label.BitmapEffect>
        </Label>
        <TextBox Background="AliceBlue" FlowDirection="LeftToRight" FontSize="10" Height="23" HorizontalContentAlignment="Right" IsReadOnly="True" Margin="0,260.68,371.223,0" Name="txtSelectedObjectCreated" TextAlignment="Right" VerticalAlignment="Top" VerticalContentAlignment="Stretch" HorizontalAlignment="Right" Width="111" />
        <Label FlowDirection="LeftToRight" FontSize="10" Foreground="CadetBlue" Height="23" HorizontalAlignment="Right" Margin="0,260.68,434.223,0" Name="label12" VerticalAlignment="Top" VerticalContentAlignment="Center" Width="48">Created</Label>
        <TextBox Background="AliceBlue" FlowDirection="LeftToRight" FontSize="10" Height="23" HorizontalContentAlignment="Right" IsReadOnly="True" Margin="0,259.68,254,0" Name="txtSelectedObjectModified" TextAlignment="Right" VerticalAlignment="Top" VerticalContentAlignment="Stretch" HorizontalAlignment="Right" Width="111" />
        <Label FlowDirection="LeftToRight" FontSize="10" Foreground="CadetBlue" Height="23" HorizontalAlignment="Right" Margin="0,259.68,312,0" Name="label14" VerticalAlignment="Top" VerticalContentAlignment="Center" Width="53">Modified</Label>
        <ListBox IsSynchronizedWithCurrentItem="False" ItemsSource="{Binding Mode=Default}" HorizontalAlignment="Right" Margin="0,260,17,251" Name="lsbTableKeys" Width="196.765" Background="AliceBlue" Visibility="Visible" />
        <TextBox Background="AliceBlue" FlowDirection="LeftToRight" FontSize="10" Height="23" HorizontalAlignment="Right" HorizontalContentAlignment="Right" IsReadOnly="True" Margin="0,231,17,0" Name="txtTablesKeysCount" TextAlignment="Right" VerticalAlignment="Top" VerticalContentAlignment="Stretch" Width="143" Visibility="Visible" />
        <!-- Tabs for Uses/Maybe Used By -->
        <TabControl Background="{x:Null}" BorderBrush="{x:Null}" BorderThickness="0" HorizontalContentAlignment="Center" Margin="300.198,135,488,30" Name="tabObjectUses" Opacity="1" Style="{DynamicResource GelTabControl}" TabStripPlacement="Top" Padding="0">
            <TabItem Cursor="Hand" FontSize="12" Foreground="White" Header="Uses" HorizontalAlignment="Right" Padding="5,0" Style="{DynamicResource GelTabItem}" VerticalAlignment="Bottom" Name="tabItemUses">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="272*" MinHeight="4.284" />
                        <RowDefinition Height="0.47*" />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" MinWidth="244.188" />
                    </Grid.ColumnDefinitions>
                    <ListView FontSize="12" Foreground="Black" ItemsSource="{Binding Mode=Default}" HorizontalAlignment="Left" Width="266.421" Margin="-5.421,-2.04,0,-10.705" Name="lsvObjectUses" Visibility="Visible" Padding="0" BorderThickness="0,0,0,0"  MinHeight="310" ScrollViewer.VerticalScrollBarVisibility="Visible" IsSynchronizedWithCurrentItem="False" Grid.RowSpan="2">
                        <ListView.Background>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="#FFE1E1E1" Offset="0"/>
                                <GradientStop Color="#FFFFFFFF" Offset="1"/>
                            </LinearGradientBrush>
                        </ListView.Background>
                        <ListView.View>
                            <GridView>
                                <GridView.ColumnHeaderContainerStyle>
                                    <Style TargetType="{x:Type GridViewColumnHeader}">
                                        <Setter Property="Visibility" Value="Collapsed" />
                                    </Style>
                                </GridView.ColumnHeaderContainerStyle>
                                <GridViewColumn Width="Auto">
                                    <GridViewColumn.CellTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Horizontal" Height="16">
                                                <Image Source="{Binding ObjectImagePath}" Width="16" Height="16" Margin="0" Stretch="None" />
                                                <Label Content="{Binding ObjectName}" Margin="5,0,0,0" Padding="0,0,0,0" />
                                            </StackPanel>
                                        </DataTemplate>
                                    </GridViewColumn.CellTemplate>
                                </GridViewColumn>
                            </GridView>
                        </ListView.View>
                    </ListView>
                </Grid>
            </TabItem>
            <TabItem Cursor="Hand" FontSize="12" Foreground="White" Header="Maybe Used By" HorizontalAlignment="Left" HorizontalContentAlignment="Stretch" Padding="5,0" Style="{DynamicResource GelTabItem}" VerticalAlignment="Bottom" Name="tabItemMaybeUsedBy">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" MinHeight="310" />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" MinWidth="261" />
                    </Grid.ColumnDefinitions>


                    <ListView FontSize="12" Foreground="Black" ItemsSource="{Binding Mode=Default}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="266" Margin="-5,0,0,0" Name="lsvMaybeUsedBy" Visibility="Visible" Padding="0" BorderThickness="0,0,0,0"  MinHeight="310" ScrollViewer.VerticalScrollBarVisibility="Visible" IsSynchronizedWithCurrentItem="False" Height="310">
                        <ListView.Background>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="#FFE1E1E1" Offset="0"/>
                                <GradientStop Color="#FFFFFFFF" Offset="1"/>
                            </LinearGradientBrush>
                        </ListView.Background>
                        <ListView.View>
                            <GridView>
                                <GridView.ColumnHeaderContainerStyle>
                                    <Style TargetType="{x:Type GridViewColumnHeader}">
                                        <Setter Property="Visibility" Value="Collapsed"/>
                                    </Style>
                                </GridView.ColumnHeaderContainerStyle>
                                <GridViewColumn Width="30">
                                    <GridViewColumn.CellTemplate>
                                        <DataTemplate>
                                            <!-- <TextBox Text="{Binding type}"  /> -->
                                            <Image Source="{Binding ObjectImagePath}" Width="16" Height="16" Margin="0" Stretch="None" />
                                        </DataTemplate>
                                    </GridViewColumn.CellTemplate>
                                </GridViewColumn>
                                <GridViewColumn Header=" Name                                                   " DisplayMemberBinding="{Binding ObjectName}" Width="Auto" />
                            </GridView>
                        </ListView.View>
                    </ListView>
                </Grid>
            </TabItem>
        </TabControl>
        <Label ClipToBounds="False" Foreground="White" Height="29" HorizontalAlignment="Right" Margin="0,225,166,0" Name="label6" Padding="0,5" VerticalAlignment="Top" Width="48">Keys</Label>
        <TreeView ItemsSource="{Binding}" Margin="0,3,84,0" x:Name="trvAllObjects" IsTextSearchEnabled="True" HorizontalAlignment="Right" Width="21" SelectedItemChanged="trvAllObjects_SelectedItemChanged" FontSize="13" FontWeight="Normal" BorderThickness="1,1,1,1" BorderBrush="#FF4C77C4" Foreground="#FF1D1D1D" TabIndex="9" Height="57" VerticalAlignment="Top" Visibility="Hidden">
            <TreeView.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFE1E1E1" Offset="0" />
                    <GradientStop Color="#FFFFFFFF" Offset="1" />
                </LinearGradientBrush>
            </TreeView.Background>
        </TreeView>
        <ListBox Visibility="Hidden" ItemsSource="{Binding Mode=Default}" x:Name="lsbObjectsConnected" SelectionChanged="lsbObjectsConnected_SelectionChanged" IsEnabled="False" TabIndex="11" HorizontalAlignment="Right" Width="28.198" Margin="0,5,136.802,0" FontSize="12" Height="56" VerticalAlignment="Top">
            <ListBox.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFE1E1E1" Offset="0" />
                    <GradientStop Color="#FFFFFFFF" Offset="1" />
                </LinearGradientBrush>
            </ListBox.Background>
        </ListBox>
        <ListBox Visibility="Hidden" ItemsSource="{Binding Mode=Default}" x:Name="lsbObjectsPossConnected" SelectionChanged="lsbObjectsConnected_SelectionChanged" IsEnabled="False" TabIndex="11" HorizontalAlignment="Right" Width="20" Margin="0,4,111,0" Height="56" FontSize="12" VerticalAlignment="Top">
            <ListBox.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFE1E1E1" Offset="0" />
                    <GradientStop Color="#FFFFFFFF" Offset="1" />
                </LinearGradientBrush>
            </ListBox.Background>
        </ListBox>
        <TabControl Style="{DynamicResource GelTabControl}" Margin="0,49,22,0" x:Name="tabServerLoginTab" BorderBrush="{x:Null}" Opacity="1" Background="{x:Null}" TabStripPlacement="Top" HorizontalContentAlignment="Center" BorderThickness="0,0,0,0" Grid.IsSharedSizeScope="True" HorizontalAlignment="Right" Width="129" Height="26" VerticalAlignment="Top" IsEnabled="False" Visibility="Hidden">
            <TabItem Style="{DynamicResource GelTabItem}" Header="SQL Server" FontSize="10" HorizontalAlignment="Right" VerticalAlignment="Bottom" Padding="5,1,5,1" Foreground="#FFFFFFFF" Cursor="Hand">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="25"></RowDefinition>
                        <RowDefinition Height="25"></RowDefinition>
                        <RowDefinition Height="20"></RowDefinition>
                        <RowDefinition Height="25"></RowDefinition>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" MinWidth="15"></ColumnDefinition>
                        <ColumnDefinition Width="Auto" MinWidth="75"></ColumnDefinition>
                        <ColumnDefinition Width="Auto" MinWidth="75"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                </Grid>
            </TabItem>
            <TabItem Style="{DynamicResource GelTabItem}" Header="SSRS Server" FontSize="10" HorizontalAlignment="Left" VerticalAlignment="Bottom" HorizontalContentAlignment="Stretch" Padding="5,1,5,1" Foreground="#FFFFFFFF" Cursor="Hand" IsEnabled="False" Background="#00FFFFFF">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="25"></RowDefinition>
                        <RowDefinition Height="25"></RowDefinition>
                        <RowDefinition Height="20"></RowDefinition>
                        <RowDefinition Height="25"></RowDefinition>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBox Grid.Column="0" Grid.ColumnSpan="3" Grid.Row="0" Background="{x:Null}" BorderThickness="0" FontSize="10" FontStyle="Normal" Foreground="LightGray" Height="23" HorizontalAlignment="Left" x:Name="txtReportSQLServerName" TabIndex="1" VerticalAlignment="Top" VerticalContentAlignment="Center" Visibility="Visible" Width="171" Text="Report Server Name" Panel.ZIndex="1" Margin="0,2,5,2" />
                    <ProgressBar Grid.Column="0" Grid.ColumnSpan="3" Grid.Row="0" Background="White" FlowDirection="LeftToRight" Foreground="Orange" Height="23" HorizontalAlignment="Stretch" IsIndeterminate="False" x:Name="pgbReportSQLServerConnection" Orientation="Horizontal" VerticalAlignment="Top" Visibility="Visible" Width="Auto" Margin="0,2,5,2" />
                    <TextBox Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1" FontSize="10" FontStyle="Normal" Foreground="LightGray" Height="23" x:Name="txtReportSQLServerUser" TabIndex="2" VerticalAlignment="Top" VerticalContentAlignment="Center" Visibility="Visible" Width="Auto" Text="User" HorizontalAlignment="Stretch" Margin="0,1,2,1" />
                    <PasswordBox Grid.Column="3" Grid.ColumnSpan="1" Grid.Row="1" FontSize="10" FontStyle="Normal" Foreground="LightGray" Height="23" x:Name="psdReportSQLServerPassword" Password="Password" TabIndex="3" VerticalAlignment="Top" VerticalContentAlignment="Center" Visibility="Visible" Width="Auto" HorizontalAlignment="Stretch" Margin="5,1,5,1" />
                    <CheckBox Grid.Column="0" Grid.ColumnSpan="3" Grid.Row="2" FontSize="11" Foreground="LightGray" Height="16" HorizontalAlignment="Stretch" x:Name="chkReportConnectionIsIntegrated" TabIndex="4" VerticalAlignment="Center" Visibility="Visible" Width="Auto" Content="Use Windows Authentication" Margin="0,0,5,0" BorderThickness="1,1,1,1" />
                    <Button Grid.Column="1" Grid.ColumnSpan="1" Grid.Row="3" Height="23" HorizontalAlignment="Right" IsEnabled="False" x:Name="btnReportServerLogin" TabIndex="5" VerticalAlignment="Center" Visibility="Visible" Width="58" Content="Login" Margin="5,1,2,1" />
                    <Button Grid.Column="2" Grid.ColumnSpan="1" Grid.Row="3" Height="23" IsCancel="True" IsEnabled="False" x:Name="btnReportServerLoginCancel" Width="58" HorizontalAlignment="Left" VerticalAlignment="Stretch" Content="Cancel" Margin="5,1,5,1" />
                </Grid>
            </TabItem>
        </TabControl>
        <TabControl Margin="11,135,0,29" Name="tabObjectBrowser" HorizontalAlignment="Left" Width="270" Padding="0">
            <TabItem Header="Object Types" Name="tabItem1" Height="24">
                <Grid Background="LightGray">
                    <ListView FontSize="12" Foreground="Black" ItemsSource="{Binding Mode=Default}" Margin="1,34,2,2" Name="lsvAllObjectTypes" Visibility="Visible" Padding="0" BorderThickness="0,0,0,0" MinHeight="0" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Hidden" SelectionMode="Single" SelectionChanged="lsvAllObjectTypes_SelectionChanged">
                        <ListView.Background>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="#FFE1E1E1" Offset="0" />
                                <GradientStop Color="#FFFFFFFF" Offset="1" />
                            </LinearGradientBrush>
                        </ListView.Background>
                        <ListView.View>
                            <GridView AllowsColumnReorder="False">
                                <GridView.ColumnHeaderContainerStyle>
                                    <Style TargetType="{x:Type GridViewColumnHeader}">
                                        <Setter Property="Visibility" Value="Collapsed" />
                                    </Style>
                                </GridView.ColumnHeaderContainerStyle>
                                <GridViewColumn Width="250">
                                    <GridViewColumn.CellTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Horizontal" Height="22">
                                                <Image Source="{Binding ObjectImagePath}" Width="16" Height="16" Margin="0" Stretch="None" />
                                                <Label Content="{Binding ObjectTypeFull}" Padding="2" Margin="2" />
                                            </StackPanel>
                                        </DataTemplate>
                                    </GridViewColumn.CellTemplate>
                                </GridViewColumn>
                            </GridView>
                        </ListView.View>
                    </ListView>
                    <ComboBox ItemsSource="{Binding}" Height="23" Margin="46,6,6,0" x:Name="ddlDatabaseSchemas" VerticalAlignment="Top" SelectedIndex="0" IsEnabled="False" TabIndex="7" />
                    <Label ClipToBounds="False" Foreground="Black" Height="20" HorizontalAlignment="Left" Margin="6,10,0,0" x:Name="label3" Padding="0" VerticalAlignment="Top" Width="42" Content="Schema" FontSize="10" />
                </Grid>
            </TabItem>
            <TabItem Header="Objects" Name="tabItemObjects" AllowDrop="False" Height="24">
                <Grid Background="LightGray">
                    <ListView FontSize="12" Foreground="Black" ItemsSource="{Binding Mode=Default}" Margin="1,34,2,2" Name="lsvAllObjects" Visibility="Visible" Padding="0" BorderThickness="0,0,0,0" MinHeight="0" ScrollViewer.VerticalScrollBarVisibility="Visible" SelectionChanged="lsvAllObjects_SelectionChanged" IsSynchronizedWithCurrentItem="False">
                        <ListView.Background>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="#FFE1E1E1" Offset="0" />
                                <GradientStop Color="#FFFFFFFF" Offset="1" />
                            </LinearGradientBrush>
                        </ListView.Background>
                        <ListView.View>
                            <GridView>
                                <GridView.ColumnHeaderContainerStyle>
                                    <Style TargetType="{x:Type GridViewColumnHeader}">
                                        <Setter Property="Visibility" Value="Collapsed" />
                                    </Style>
                                </GridView.ColumnHeaderContainerStyle>
                                <GridViewColumn Width="Auto">
                                    <GridViewColumn.CellTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Horizontal" Height="16">
                                                <Image Source="{Binding ObjectImagePath}" Width="16" Height="16" Margin="0" Stretch="None" />
                                                <Label Content="{Binding ObjectName}" Margin="5,0,0,0" Padding="0,0,0,0" />
                                            </StackPanel>
                                        </DataTemplate>
                                    </GridViewColumn.CellTemplate>
                                </GridViewColumn>
                            </GridView>
                        </ListView.View>
                    </ListView>
                    <Label ClipToBounds="False" FontSize="10" Foreground="Black" Height="20" HorizontalAlignment="Left" Margin="7,10,0,0" Name="label1" Padding="0" VerticalAlignment="Top" Width="42">Filter</Label>
                    <TextBox Height="23" Margin="45,5,6,0" Name="textObjectFilter" VerticalAlignment="Top" />
                </Grid>
            </TabItem>
        </TabControl>
        <ComboBox Height="23" ItemsSource="{Binding}" Margin="11,95,0,0" x:Name="ddlDatabases" VerticalAlignment="Top" SelectedIndex="0" IsEnabled="False" MaxDropDownHeight="800" SelectionChanged="ddlDatabases_SelectionChanged" TabIndex="6" IsDropDownOpen="False" HorizontalAlignment="Left" Width="227" Text="Database" />
        <Button Height="23" Margin="244,95,0,0" x:Name="btnUseDatabase" VerticalAlignment="Top" Click="btnUseDatabase_Click" IsEnabled="False" Content="Use" TabIndex="8" HorizontalAlignment="Left" Width="37" />
        <Expander Header="SQL Server Login" Height="147.36" Margin="0,2,227,0" Name="expanderSQLLogin" VerticalAlignment="Top" Foreground="White" ExpandDirection="Down" IsExpanded="True" Background="Transparent" Padding="1" HorizontalAlignment="Right" Width="222.802">
            <Grid Background="Black">
                <TextBox x:Name="txtSQLServerName" BorderThickness="0" FontSize="10" VerticalContentAlignment="Center" Visibility="Visible" FontStyle="Normal" GotFocus="txtSQLServerName_GotFocus" Foreground="LightGray" TextChanged="txtSQLServerName_TextChanged" Background="{x:Null}" Text="Server Name" TabIndex="1" Panel.ZIndex="1" Margin="8,10,10,0" Height="23" VerticalAlignment="Top" />
                <ProgressBar Height="23" Margin="6,10,10,0" x:Name="pgbSQLServerConnection" VerticalAlignment="Top" Foreground="Orange" Background="White" IsIndeterminate="False" FlowDirection="LeftToRight" Orientation="Horizontal" Visibility="Visible" />
                <TextBox FontStyle="Normal" GotFocus="txtSQLServerUser_GotFocus" Foreground="LightGray" HorizontalAlignment="Left" x:Name="txtSQLServerUser" FontSize="10" VerticalContentAlignment="Center" Visibility="Visible" Text="User" TabIndex="2" Margin="6,39,0,58.36" HorizontalContentAlignment="Left" Width="95.223" />
                <PasswordBox FontStyle="Normal" GotFocus="psdSQLServerPassword_GotFocus" Foreground="LightGray" x:Name="psdSQLServerPassword" FontSize="10" VerticalContentAlignment="Center" Visibility="Visible" Password="Password" TabIndex="3" Margin="107,39,10,58.36" />
                <CheckBox Height="16" Margin="8,0,11,37" x:Name="chkConnectionIsIntegrated" VerticalAlignment="Bottom" Foreground="LightGray" Visibility="Visible" Checked="chkConnectionIsIntegrated_Checked" Unchecked="chkConnectionIsIntegrated_Unchecked" FontSize="11" Content="Use Windows Authentication" TabIndex="4" />
                <Button Height="23" Margin="8,0,0,8" x:Name="btnServerLogin" VerticalAlignment="Bottom" Click="btnServerLogin_Click" Visibility="Visible" IsEnabled="False" Content="Login" TabIndex="5" HorizontalAlignment="Left" Width="65" />
            </Grid>
        </Expander>
    </Grid>
</Window>
